goog.provide('czk.ui.Label');

goog.require('goog.dom');
goog.require('goog.dom.TagName');

goog.require('czk.ui.ZKComponent');

/**
 * @constructor
 * @extends {czk.ui.ZKComponent}
 */
czk.ui.Label = function() {
  goog.base(this);
};
goog.inherits(czk.ui.Label, czk.ui.ZKComponent);

czk.ui.Label.prototype.createDom = function() {
  var dh = this.getDomHelper();
  if (!this.className)
    this.className = 'description';
  var el = dh.createDom(goog.dom.TagName.SPAN, {
    'className': this.className
  }, this.value);

  this.setElementInternal(el);
};

czk.ui.Label.prototype.initialize =
    function(name, parameter, portlet, children) {
      goog.base(this, 'initialize', name, parameter, portlet, children);
      this.value = parameter['value'];
    };
czk.ui.Label.prototype.handleZKResponseCommand = function(command) {
  goog.base(this, 'handleZKResponseCommand', command);
  goog.dom.setTextContent(this.getElement(), this.value);
};
czk.ui.Label.create = function() {
  return new czk.ui.Label();

};
